//
//  CollectionViewCell.m
//  hainingOASystem
//
//  Created by michael on 2017/11/15.
//  Copyright © 2017年 czd. All rights reserved.
//

#import "picnewsCollectionViewCell.h"

@implementation picnewsCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
    _label1 = [[UILabel alloc]init];
    _label1.frame = CGRectZero;
        _label1.numberOfLines = 0;

      [_label1 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label1];
    
       _label2 = [[UILabel alloc]init];
    _label2.frame = CGRectZero;
    _label2.numberOfLines = 0;
      [_label2 setFont:[UIFont systemFontOfSize:10]];
       [self.contentView addSubview:_label2];
  
_image = [[UIImageView alloc]init];
_image.frame = CGRectZero;
       [self.contentView addSubview:_image];

}
return self;
}


- (void)layoutSubviews{
[super layoutSubviews];
_image.frame  = CGRectMake(0,0,self.contentView.width, self.contentView.height-40);
NSString *url = [NSString stringWithFormat:@"%@%@",kip,_dic[@"defaultPicUrl"]];

    [self.image sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"加载"]];
_label1.frame =CGRectMake(0, _image.bottom  ,self.contentView.width, 30);
_label1.textColor = [UIColor blackColor];//其中textColor要用UIColor类型
_label1.text = _dic[@"title"];
_label1.backgroundColor = [UIColor clearColor];
_label2.frame =CGRectMake(0, _label1.bottom,self.contentView.width, 10);
_label2.textColor = [UIColor grayColor];//其中textColor要用UIColor类型
_label2.text = _dic[@"updateTime"];

}

@end
